package cn.aibow.cppdocument;

import android.app.Dialog;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.widget.TextView;

public class InfoDialog extends Dialog {

	public InfoDialog(Context context) {
		super(context, R.style.infoDialog);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_information);
		TextView versionView = (TextView)findViewById(R.id.dialog_info_version);
		PackageManager pm = this.getContext().getPackageManager();
		try {
			PackageInfo pi = pm.getPackageInfo(this.getContext().getPackageName(), 0);
			versionView.setText(pi.versionName);
		} catch (NameNotFoundException e) {
			//e.printStackTrace();
		}
		TextView authorView = (TextView)findViewById(R.id.dialog_info_author);
		authorView.setText("aibow");
		TextView emailView = (TextView)findViewById(R.id.dialog_info_email);
		emailView.setText("wangaibo168@163.com");
		TextView websiteView = (TextView)findViewById(R.id.dialog_info_website);
		websiteView.setText("http://www.du52.com");
	}

}
